{extend name="public/base" /} {block name="body"}
<!--列表-->
<section class="panel panel-padding">
    <div class="group-button">
        <button class="layui-btn layui-btn-small layui-btn-danger ajax-all" data-params='{"url":"{:url("delmenu")}","confirm":"true","action":"del","dataName":"menu","key":"id"}'>
            <i class="iconfont">&#xe626;</i> 删除
        </button>
        <button class="layui-btn layui-btn-small layui-btn-normal ajax-all"  data-params='{"url": "/php/test.php","data":"id=1&name=hao&checkbox=6,9,0&va=23"}'>
            <i class="layui-icon">&#x1005;</i> 状态
        </button>
        <button class="layui-btn layui-btn-small modal" data-params='{"content":".add-subcat", "title":"添加顶级分类","type":"1","data":"level=0"}'>
            <i class="iconfont">&#xe649;</i> 添加
        </button>
    </div>
    <div class="layui-form">
        <table id="example" class="layui-table jq-even" data-params='{"dataName":"menu","key":"id"}'>
            <thead>
                <tr>
                    <th width="30">
                        <input type="checkbox" id="checkall" data-name="id" lay-filter="check" lay-skin="primary">
                    </th>
                    <th width="70">序号</th>
                    <th>名称</th>
                    <th>URL</th>
                    <th>规则</th>
                    <th width="70" class="txt-center">排序</th>
                    <th width="80" class="txt-center">状态</th>
                    <th width="220" class="txt-center">操作</th>
                </tr>
            </thead>
            <tbody id="list"></tbody>
        </table>
    </div>
    <div class="text-right" id="page"></div>
</section>
{/block} {block name="modal"}
<div class="add-subcat">
    <form id="form1" class="layui-form " data-params='{"dataName":"menu","key":"id","bind":true,"action":"add","pid":"pid","url":"{:url("savemenu")}"}' method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">分类名称</label>
            <div class="layui-input-block">
                <input type="text" name="name"  jq-verify="required" jq-error="请输入分类名称" placeholder="请输入分类名称" autocomplete="off" class="layui-input ">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">规则</label>
            <div class="layui-input-block">
                <input type="text" name="rule" placeholder="请输入规则" autocomplete="off" class="layui-input ">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">url</label>
            <div class="layui-input-block">
                <input type="text" name="url" placeholder="请输入菜单地址" autocomplete="off" class="layui-input ">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">上级分类</label>
            <div class="layui-input-inline">
                <select name="pid" lay-verify="required" lay-filter="pid-select" id="pid-select">
                    <option value="0">顶级分类</option>              
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">图标</label>
            <div class="layui-input-inline">
                <input type="text" name="iconfont" required value="" jq-error="请填icon图标" placeholder="请填icon图标" autocomplete="off" class="layui-input ">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-inline">
                <input type="text" name="sort" required jq-verify="number" value="100" jq-error="排序必须为数字" placeholder="分类排序" autocomplete="off" class="layui-input ">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-inline">
                <input type="radio" name="status" title="启用" value="1" checked />
                <input type="radio" name="status" title="禁用" value="0" />
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" jq-submit jq-filter="submit">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
        <input type="hidden" name="allow_del" value="1" />
         <input type="hidden" name="level" value="0" />
    </form>
</div>
{include file="tpl/cat"} {/block} {block name="script"}
<script>
layui.use('list');
</script>
{/block}